package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.SickPersonMapper;
import com.ruoyi.manage.domain.SickPerson;
import com.ruoyi.manage.service.ISickPersonService;

/**
 * 患者，一般对接第三方Service业务层处理
 * 
 * @author liuyangyang
 * @date 2025-05-28
 */
@Service
public class SickPersonServiceImpl implements ISickPersonService 
{
    @Autowired
    private SickPersonMapper sickPersonMapper;

    /**
     * 查询患者，一般对接第三方
     * 
     * @param sickPersonId 患者，一般对接第三方主键
     * @return 患者，一般对接第三方
     */
    @Override
    public SickPerson selectSickPersonBySickPersonId(Long sickPersonId)
    {
        return sickPersonMapper.selectSickPersonBySickPersonId(sickPersonId);
    }

    /**
     * 查询患者，一般对接第三方列表
     * 
     * @param sickPerson 患者，一般对接第三方
     * @return 患者，一般对接第三方
     */
    @Override
    public List<SickPerson> selectSickPersonList(SickPerson sickPerson)
    {
        return sickPersonMapper.selectSickPersonList(sickPerson);
    }

    /**
     * 新增患者，一般对接第三方
     * 
     * @param sickPerson 患者，一般对接第三方
     * @return 结果
     */
    @Override
    public int insertSickPerson(SickPerson sickPerson)
    {
        sickPerson.setCreateTime(DateUtils.getNowDate());
        return sickPersonMapper.insertSickPerson(sickPerson);
    }

    /**
     * 修改患者，一般对接第三方
     * 
     * @param sickPerson 患者，一般对接第三方
     * @return 结果
     */
    @Override
    public int updateSickPerson(SickPerson sickPerson)
    {
        sickPerson.setUpdateTime(DateUtils.getNowDate());
        return sickPersonMapper.updateSickPerson(sickPerson);
    }

    /**
     * 批量删除患者，一般对接第三方
     * 
     * @param sickPersonIds 需要删除的患者，一般对接第三方主键
     * @return 结果
     */
    @Override
    public int deleteSickPersonBySickPersonIds(Long[] sickPersonIds)
    {
        return sickPersonMapper.deleteSickPersonBySickPersonIds(sickPersonIds);
    }

    /**
     * 删除患者，一般对接第三方信息
     * 
     * @param sickPersonId 患者，一般对接第三方主键
     * @return 结果
     */
    @Override
    public int deleteSickPersonBySickPersonId(Long sickPersonId)
    {
        return sickPersonMapper.deleteSickPersonBySickPersonId(sickPersonId);
    }
}
